﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MeTalker.Aide.data;

namespace MeTalker.Aide.Forms
{
    internal partial class frmTestMenu : MeForm
    {
        MessageNode node;
        GuideBase baseGuide;
        private frmTestMenu()
        {
            InitializeComponent();
            this.ss.StateNormal.Image = new Bitmap("icons/menu.jpg");// ((System.Drawing.Image)(resources.GetObject("kryptonPanel1.StateNormal.Image")));
            //DataFactory.GetInitialization();
            //node = DataFactory.Menus.Nodes[0];
            //this.ShowInTaskbar = true;
        }

        public frmTestMenu(MessageNode node)
            : this()
        {
            this.node = node;
            this.Text += " : " + node.Title;
            baseGuide = new GuideBase(new ProcInfo() { Account = "test", Alias = "test" });
            baseGuide.Menu = node;
            txtMessage.AppendText(baseGuide.FindMenuMessage("test", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "test"));
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            string sendText = txtSendMessaeg.Text;
            TextMenu(sendText);
        }

        void TextMenu(string sendText)
        {
            txtSendMessaeg.Text = "";
            txtMessage.AppendText(sendText + "\n");
            txtMessage.AppendText(baseGuide.FindMenuMessage("test", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), sendText));
            txtMessage.ScrollToCaret();
        }

        private void txtMessage_TextChanged(object sender, EventArgs e)
        {

        }
    }
}